package com.smbms.service.user.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.smbms.dao.user.mapper.UserMapper;
import com.smbms.pojo.User;
import com.smbms.service.user.UserService;

@Service("userService")
public class UserServiceImpl implements UserService {
	
	@Autowired
	private UserMapper userMapper;

	public List<User> findUsersByConditions(User user) {
		List<User> user1 = userMapper.searchByNameAndRole(user.getUserName(), user.getUserRole());

		return user1;

	}
	
	public int findUsersByConditions1(User user){
		int num = userMapper.getUserList(user);
		//int aa = 10/0;  //模拟异常
		return num;

	}

	@Override
	public Integer insertUser(User user) {
		return userMapper.add(user);

	}
	
	
	

	/*public UserMapper getUserMapper() {
		return userMapper;
	}

	public void setUserMapper(UserMapper userMapper) {
		this.userMapper = userMapper;
	}*/

	
}
